class Solution {
public:
    string arr[10]={"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
    vector<string> v;
    string path;
    vector<string> letterCombinations(string d) {
        if(d.size()==0) return v;
        dfs(d,0);
        return v;
    }

    void dfs(string& d,int pos)
    {
        if(pos==d.size())
        {
            v.push_back(path);
            return;
        }

        for(auto ch:arr[d[pos]-'0'])
        {
            path.push_back(ch);
            dfs(d,pos+1);
            path.pop_back();
        }
    }
};
